import './global.css';
import '@gm/shadcn-ui/globals.css';
import '@gm/common-ui/globals.css';
import localFont from 'next/font/local';
import { dir, i18nConfig, locale } from '@gm/locale';
import { notFound } from 'next/navigation';

const font = localFont({
  src: [
    {
      path: './asset/font/MapleMono/MapleMono-Regular.ttf.woff2',
      weight: '400',
      style: 'normal',
    },
    {
      path: './asset/font/MapleMono/MapleMono-Italic.ttf.woff2',
      weight: '400',
      style: 'italic',
    },
    {
      path: './asset/font/MapleMono/MapleMono-SemiBold.ttf.woff2',
      weight: '700',
      style: 'normal',
    },
    {
      path: './asset/font/MapleMono/MapleMono-MediumItalic.ttf.woff2',
      weight: '700',
      style: 'italic',
    },
  ],
});

// export { generateStaticParams };

export default async function RootLayout({
  children,
  params,
}: {
  children: React.ReactNode;
  params: Promise<{ locale: locale }>;
}) {
  const { locale } = await params;

  // if (!i18nConfig.locales.includes(locale)) {
  //   notFound();
  // }
  return (
    <html lang={locale} dir={dir(locale)}>
      <body className={`${font.className} min-h-screen w-full m-0 p-0`}>
        <main className="w-full h-full bg-background text-foreground relative overflow-hidden">
          {children}
        </main>
      </body>
    </html>
  );
}
